package com.chb.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chihb
 * @create-time 2024/10/24 16:58
 * @description
 */
public class StudentListImpl implements StudentList{
    private List<Student> list=new ArrayList<>();
    @Override
    public void addStudent(Student student) {
        list.add(student);
    }

    @Override
    public void removeStudent(Student student) {
        list.remove(student);
    }

    @Override
    public StudentIterator getIterator() {
        return new StudentIteratorImpl(list);
    }
}
